#ifndef __ServerInfo_h__
#define __ServerInfo_h__
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <vector>
#include <map>
#include <string>

using namespace std;

class ServerInfo {
	protected:
		map<string, string> rules;
		map<string, string> attributes;
		struct sockaddr_in addr;
	public:
		virtual ~ServerInfo() {};
		virtual const struct sockaddr_in *getAddress() const = 0;
		virtual bool update(int timeout_sec = 3, int timeout_usec = 0) = 0;
		virtual bool updateRules(int timeout_sec = 3, int timeout_usec = 0) = 0;

		virtual void addRule(string a, string b) { rules[a] = b; };
		virtual const map<string, string> & getRules() { return rules; };
		virtual const map<string, string> & getAttributes() { return attributes; };
};

#endif
